import http from '@/utils/http'

interface codeType {
  code: string
}
/**
 * @desc https://www.showdoc.com.cn/2077491945864902/9409379167292669
 * @param {*} phone 手机号
 * @returns Promise
 */
export const reqRegister = (phone: string) => {
  return http.get<any, codeType>(`/api/user/passport/sendCode/${phone}`)
}

interface dataType {
  phone: string
  password: string
  code: string
}

/**
 * @desc https://www.showdoc.com.cn/2077491945864902/9409373367567348
 * @param {*} data 手机号，密码，验证码
 * @returns Promise
 */
export const reqRegisterOver = (data: dataType) => {
  return http.post<any, any>('/api/user/passport/register', data)
}
